from django.shortcuts import render
from django.views.decorators import csrf
from data_structure import stack as stacks

# Create your views here.

def index(request):
    return render(request, 'home.html')


def getresult(request):
    ctx = {}
    if request.POST:
        str_input = request.POST['iWord']
        ctx['original'] = str_input
        ctx['rlt'] = stacks.get_stack_value(str_input)
    return render(request, "home.html", ctx)
